#!/usr/bin/env coffee

> fs > readFileSync
  path > join

import {default as $decode,kv as $kv,map as $map,nodefault as $nodefault} from './decode.js'
import {string as $string,u64Li as $u64Li,u64 as $u64} from './decode/types.js'

{dirname:ROOT} = import.meta

bin = readFileSync join(
  ROOT,'test_rust/out/sign2'
)
map = $map(
  $string,
  '',
  $string,
  ''
)
console.log map bin


bin = readFileSync join(
  ROOT,'test_rust/out/sign3'
)

Sign3 = $nodefault(
  [$kv($string,"",$string,""),$u64Li],[1],[0]
)

console.log Sign3 bin

bin = readFileSync join(
  ROOT,'test_rust/out/sign5'
)

Sign5  = $decode(
  [$kv($string,"",$string,""),$u64],
  [3,0]
)

console.log Sign5 bin
